<template>
  <div class="custom-form">
    <el-row :gutter="15">
      <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px" :key="showFormKey">
        <el-col :span="24">
          <el-form-item label-width="0" prop="field100bdab">
            <h2 align='center' style="color:undefined;font-size: nullpx;text-align: center">耗材供应商名录</h2>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('job')" v-show="false">
          <el-form-item :label="$t('职级名称')" prop="job">
            <el-input v-model="formData['job']" placeholder="请输入职级名称" :disabled="hasDisabledPermission('job', false)"
              :readonly="!hasEditPermission('job', false)" clearable :style="{ width: '100%' }"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('role_id')" v-show="false">
          <el-form-item :label="$t('角色ID')" prop="role_id">
            <el-input v-model="formData['role_id']" placeholder="请输入角色ID"
              :disabled="hasDisabledPermission('role_id', false)" :readonly="!hasEditPermission('role_id', false)"
              clearable :style="{ width: '100%' }">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('role_name')" v-show="false">
          <el-form-item :label="$t('角色名称')" prop="role_name">
            <el-input v-model="formData['role_name']" placeholder="请输入角色名称"
              :disabled="hasDisabledPermission('role_name', false)" :readonly="!hasEditPermission('role_name', false)"
              clearable :style="{ width: '100%' }">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('area')" v-show="false">
          <el-form-item :label="$t('地区')" prop="area">
            <el-input v-model="formData['area']" placeholder="请输入地区" :disabled="hasDisabledPermission('area', false)"
              :readonly="!hasEditPermission('area', false)" clearable :style="{ width: '100%' }"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('user_id')" v-show="false">
          <el-form-item :label="$t('申请人ID')" prop="user_id">
            <el-input v-model="formData['user_id']" placeholder="请输入申请人ID"
              :disabled="hasDisabledPermission('user_id', false)" :readonly="!hasEditPermission('user_id', false)"
              clearable :style="{ width: '100%' }">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('apply_time')" v-show="false">
          <el-form-item :label="$t('申请时间')" prop="apply_time">
            <el-input v-model="formData['apply_time']" placeholder="请输入申请时间"
              :disabled="hasDisabledPermission('apply_time', false)" :readonly="!hasEditPermission('apply_time', false)"
              clearable :style="{ width: '100%' }">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('user_name')">
          <el-form-item :label="$t('申请人名称')" prop="user_name">
            <el-input v-model="formData['user_name']" placeholder="请输入申请人名称"
              :disabled="hasDisabledPermission('user_name', false)" 
              :readonly="true"
              clearable :style="{ width: '100%' }">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('depart_short_name')" v-show="false">
          <el-form-item :label="$t('部门简称')" prop="depart_short_name">
            <el-input v-model="formData['depart_short_name']" placeholder="请输入部门简称"
              :disabled="hasDisabledPermission('depart_short_name', false)"
              :readonly="!hasEditPermission('depart_short_name', false)" clearable :style="{ width: '100%' }">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('depart_id')">
          <el-form-item :label="$t('部门')" prop="depart_id">
            <el-select v-model="formData['depart_id']" placeholder="请选择部门"
              :disabled="hasDisabledPermission('depart_id', false)" @change="departmentChange" filterable clearable
              :style="{ width: '100%' }">
              <el-option v-for="(item, index) in departmentData" :key="index" :label="item.F_FullName"
                :value="item.F_DepartmentId" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('current_user_id')" v-show="false">
          <el-form-item :label="$t('当前用户')" prop="current_user_id">
            <avue-information-body :operationVal="operationVal" infoType='user' :whetherToRebindSecondaryEditing='false'
              v-model="formData['current_user_id']" placeholder="公司当前当前用户"
              :disabled="hasDisabledPermission('current_user_id', true)"
              :readonly="!hasEditPermission('current_user_id', true)" :style="{ width: '100%' }">
            </avue-information-body>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('is_effective')" v-show="false">
          <el-form-item :label="$t('是否生效')" prop="is_effective">
            <el-input v-model="formData['is_effective']" placeholder="请输入是否生效"
              :disabled="hasDisabledPermission('is_effective', false)"
              :readonly="!hasEditPermission('is_effective', false)" clearable :style="{ width: '100%' }">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('supplier_scope')">
          <el-form-item :label="$t('供应范围')" prop="supplier_scope">
            <el-select v-model="formData['supplier_scope']" placeholder="请选择供应范围"
              :disabled="hasDisabledPermission('supplier_scope', false)" filterable clearable
              :style="{ width: '100%' }">
              <el-option v-for="(item, index) in supplier_scopeOptions" :key="index" :label="item.F_ItemName"
                :value="item.F_ItemValue" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('address')">
          <el-form-item :label="$t('省市区')" prop="address">
            <!-- <el-select v-model="formData['address']" placeholder="请选择省市区"
              :disabled="hasDisabledPermission('address', false)" filterable clearable :style="{ width: '100%' }">
              <el-option v-for="(item, index) in addressOptions" :key="index" :label="item.label" :value="item.value"
                :disabled="item.disabled"></el-option>
            </el-select> -->
            <avue-select-area v-model="formData['address']" :clearable="true"
              :disabled="hasDisabledPermission('address', false)" :readonly="!hasEditPermission('address', false)">
            </avue-select-area>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('address_desc')">
          <el-form-item :label="$t('')" prop="address_desc">
            <el-input v-model="formData['address_desc']" type="textarea" placeholder="详细地址"
              :disabled="hasDisabledPermission('address_desc', false)"
              :readonly="!hasEditPermission('address_desc', false)" :autosize="{ minRows: 4, maxRows: 4 }"
              :style="{ width: '100%' }"></el-input>
          </el-form-item>
        </el-col>
        <!-- 对方联系人 -->
        <el-col :span="24">
          <el-form-item :label="$t('对方联系人')" prop="party_contact_dto">
            <div class="table">
              <div class="table-header">
                <div class="table-header-name itemsss">姓名</div>
                <div class="table-header-phone itemsss">电话</div>
                <div class="table-header-company itemsss">公司</div>
                <div class="table-header-position itemsss">职位</div>
                <div class="table-header-address itemsss">地址</div>
                <div class="table-header-email itemsss">邮箱</div>
                <div class="table-header-remark itemsss">备注</div>
              </div>
              <div class="table-body">
                <div class="table-header-name itemsss">
                  <el-input v-model="formData.party_contact_dto.party_contact_name" placeholder="请输入姓名"></el-input>
                </div>
                <div class="table-header-phone itemsss">
                  <el-input v-model="formData.party_contact_dto.party_contact_mobile_num" placeholder="请输入电话">
                  </el-input>
                </div>
                <div class="table-header-company itemsss">
                  <el-input v-model="formData.party_contact_dto.party_contact_company" placeholder="请输入公司"></el-input>
                </div>
                <div class="table-header-position itemsss">
                  <el-input v-model="formData.party_contact_dto.party_contact_position" placeholder="请输入职位"></el-input>
                </div>
                <div class="table-header-address itemsss">
                  <el-input v-model="formData.party_contact_dto.party_contact_address" placeholder="请输入地址"></el-input>
                </div>
                <div class="table-header-email itemsss">
                  <el-input v-model="formData.party_contact_dto.party_contact_email_address" placeholder="请输入邮箱">
                  </el-input>
                </div>
                <div class="table-header-remark itemsss">
                  <el-input v-model="formData.party_contact_dto.party_contact_remark" placeholder="请输入备注"></el-input>
                </div>
              </div>
            </div>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('supplier_name')">
          <el-form-item :label="$t('供应商名称')" prop="supplier_name">
            <el-input v-model="formData['supplier_name']" placeholder="请输入供应商名称"
              :disabled="hasDisabledPermission('supplier_name', false)"
              :readonly="!hasEditPermission('supplier_name', false)" clearable :style="{ width: '100%' }">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('receive_account')">
          <el-form-item :label="$t('收款账户')" prop="receive_account">
            <el-input v-model="formData['receive_account']" placeholder="请输入收款账户"
              :disabled="hasDisabledPermission('receive_account', false)"
              :readonly="!hasEditPermission('receive_account', false)" clearable :style="{ width: '100%' }">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('buiness_license_file_url')">
          <el-form-item :label="$t('营业执照')" prop="buiness_license_file_url">
            <xjr-custom-upload :config="buiness_license_file_urlConfig"
              :disabled="hasDisabledPermission('buiness_license_file_url', false)"
              v-model="formData['buiness_license_file_url']" list-type="text"></xjr-custom-upload>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('safe_license_file_url')">
          <el-form-item :label="$t('安全生产许可证')" prop="safe_license_file_url">
            <xjr-custom-upload :config="safe_license_file_urlConfig"
              :disabled="hasDisabledPermission('safe_license_file_url', false)"
              v-model="formData['safe_license_file_url']" list-type="text"></xjr-custom-upload>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('check_file_url')">
          <el-form-item :label="$t('质检报告/检测报告')" prop="check_file_url">
            <xjr-custom-upload :config="check_file_urlConfig" :disabled="hasDisabledPermission('check_file_url', false)"
              v-model="formData['check_file_url']" list-type="text"></xjr-custom-upload>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasWorkFlowFormPermission('field121f2da')" v-show="optionsFlag">
          <el-form-item :label="$t('意见簿')" prop="field121f2da">
            <xjr-opinion-comonent :value="formData.field121f2da"></xjr-opinion-comonent>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="!isWorkflowForm">
          <el-form-item size="large" v-if="isEdit">
            <el-button type="primary" @click="submitForm" :loading="submitLoading">
              {{ submitLoading ? $t('workFlow.WFMenu.hintSubmit') : $t('submit') }}</el-button>
            <el-button @click="cancelForm">{{ $t('cancelText') }}</el-button>
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>
  </div>
</template>
<script>

import FilterableDataList from '@/components/generator/clientComponents/FilterableDataList.vue';
import workflowFormAuthorize from "@/mixins/workflowFormAuthorize";
import authorizeMixin from "@/mixins/authorize";
import { baseUrl } from "@/config/env";
import request from "@/router/axios";
import { getUserDetailsById } from '@/api/user.js';
export default {
  mixins: [authorizeMixin, workflowFormAuthorize],

  components: {},
  props: ['keyValue', 'isEdit', 'disabled'],
  data() {
    let _this = this
    return {
      submitLoading: false,
      showForm: true,
      showFormKey: 1,
      reRenderSubform: false,
      operationVal: 'add',
      isAdd: true,
      addressUrl: 'material_supplier',
      mainTableName: 'material_supplier',
      formConfig: {},
      formData: {
        'field100bdab': '',
        'job': '',
        'role_id': '',
        'role_name': '',
        'area': '',
        'user_id': '',
        'apply_time': '',
        'user_name': '',
        'depart_short_name': '',
        'depart_id': '',
        'current_user_id': '',
        'is_effective': '0',
        'supplier_scope': '',
        'address': '',
        'address_desc': '',
        'supplier_name': '',
        'receive_account': '',
        'buiness_license_file_url': null,
        'safe_license_file_url': null,
        'check_file_url': null,
        'field121f2da': null,
        //对方联系人
        party_contact_dto: {
          party_contact_name: '',
          party_contact_mobile_num: '',
          party_contact_company: '',
          party_contact_position: '',
          party_contact_address: '',
          party_contact_email_address: '',
          party_contact_remark: '',
        },
      },
      rules: {
        job: [{
          required: true,
          message: '请输入职级名称',
          trigger: 'blur'
        }],
        role_id: [{
          required: true,
          message: '请输入角色ID',
          trigger: 'blur'
        }],
        role_name: [{
          required: true,
          message: '请输入角色名称',
          trigger: 'blur'
        }],
        area: [{
          required: true,
          message: '请输入地区',
          trigger: 'blur'
        }],
        user_id: [{
          required: true,
          message: '请输入申请人ID',
          trigger: 'blur'
        }],
        apply_time: [{
          required: false,
          message: '请输入申请时间',
          trigger: 'blur'
        }],
        user_name: [{
          required: true,
          message: '请输入申请人名称',
          trigger: 'blur'
        }],
        depart_short_name: [{
          required: true,
          message: '请输入部门简称',
          trigger: 'blur'
        }],
        depart_id: [{
          required: true,
          message: '请选择部门',
          trigger: 'change'
        }],
        is_effective: [{
          required: true,
          message: '请输入是否生效',
          trigger: 'blur'
        }],
        supplier_scope: [{
          required: true,
          message: '请选择供应范围',
          trigger: 'change'
        }],
        address: [{
          required: true,
          message: '请选择省市区',
          trigger: 'change'
        }],
        address_desc: [{
          required: true,
          message: '详细地址',
          trigger: 'blur'
        }],
        supplier_name: [{
          required: true,
          message: '请输入供应商名称',
          trigger: 'blur'
        }],
        receive_account: [{
          required: true,
          message: '请输入收款账户',
          trigger: 'blur'
        }],
        buiness_license_file_url: [{
          required: true,
          message: '营业执照不能为空',
          trigger: 'change'
        }],
        safe_license_file_url: [{
          required: true,
          message: '安全生产许可证不能为空',
          trigger: 'change'
        }],
        check_file_url: [{
          required: true,
          message: '质检报告/检测报告不能为空',
          trigger: 'change'
        }],
      },
      departmentData: [],//部门信息
      roleData: [],//角色信息
      supplier_scopeOptions: [],
      buiness_license_file_urlConfig: {
        "showTip": false,
        "fileSize": 2,
        "sizeUnit": "MB",
        "buttonText": "点击上传",
        "disabled": false
      },
      safe_license_file_urlConfig: {
        "showTip": false,
        "fileSize": 2,
        "sizeUnit": "MB",
        "buttonText": "点击上传",
        "disabled": false
      },
      check_file_urlConfig: {
        "showTip": false,
        "fileSize": 2,
        "sizeUnit": "MB",
        "buttonText": "点击上传",
        "disabled": false
      },
    }
  },
  computed: {},
  watch: {},
  created() {
    this.formConfig = this.getFormConfig();
  },
  async mounted() {
    //TODO   再这里做数据回填 请求表单数据

    if (this.keyValue) {
      this.isAdd = false;
    }
    if (!this.isAdd && this.keyValue) {
      this.operationVal = 'edit';
      try {
        let res = await request({
          url: baseUrl + "/" + this.addressUrl + "/" + this.keyValue,
          method: "get",
        });

        this.formData = res.data.data
        // 新增时获取信息表单反选

        this.showFormKey++;
      } catch (error) {
      }
    }


    if (typeof this.getSupplier_scopeOptions == "function") {
      await this.getSupplier_scopeOptions();
    }
    // 新增时获取信息表单反选
    setTimeout(() => {
      this.getCurrentInfo()
    }, 500)
  },
  methods: {
    getCurrentInfo() {
      let params = {
        userId: this.formData['current_user_id']
      }
      getUserDetailsById(params).then(res => {
        this.formData['user_id'] = res.data.data.F_UserId//当前申请人id
        this.formData['user_name'] = res.data.data.F_RealName//当前申请人姓名
        this.formData['area'] = res.data.data.F_Area//地区
        this.formData['job'] = res.data.data.F_Job//职级
        this.departmentData = res.data.data.F_Department//部门信息
        this.roleData = res.data.data.F_Role//角色信息
        this.initRole()
        this.initDepartmentData()
      })
    },
        initDepartmentData(){
      if(this.departmentData && this.departmentData.length == 1){
        this.formData['depart_short_name'] = this.departmentData[0].F_FullName
        this.formData['depart_id'] = this.departmentData[0].F_DepartmentId
      }
    },
    initRole() {
      let roleId = []
      let roleName = []
      if (this.roleData && this.roleData.length > 0) {
        this.roleData.forEach(e => {
          roleId.push(e.F_RoleId)
          roleName.push(e.F_FullName)
        })
      }
      this.formData['role_id'] = roleId.join(',')
      this.formData['role_name'] = roleName.join(',')
      this.formData['apply_time'] = this.getTime()
    },
    getTime() {
      let today = new Date()
      let year = today.getFullYear();
      let month = today.getMonth() + 1;//获取月份，值为0-11 表示1-12月份
      if (month <= 9) {
        month = "0" + month
      }
      let date = today.getDate();
      if (date <= 9) {
        date = "0" + date
      }
      let hours = today.getHours();
      if (hours <= 9) {
        hours = "0" + hours
      }
      let minutes = today.getMinutes()
      if (minutes <= 9) {
        minutes = "0" + minutes
      }
      let seconds = today.getSeconds();
      if (seconds <= 9) {
        seconds = "0" + seconds
      }
      let time = year + "-" + month + "-" + date + " " + hours + ":" + minutes + ":" + seconds
      return time
    },
    // 部门选择
    departmentChange(val) {
      this.departmentData.forEach(ele => {
        if (val == ele.F_DepartmentId) {
          this.formData['depart_short_name'] = ele.F_FullName
        }
      })
    },
    getFormData() {
      let key = this.mainTableName + 'Entity';
      let returnParams = {};
      returnParams[key] = this.formData;
      return {
        ...returnParams,
      };
    },
    validateForm() {
      this.$refs['elForm'].validate(valid => { });
    },
    async aysncValidateForm() {
      let validataArry = []
      validataArry.push(new Promise((resolve, reject) => {
        this.$refs['elForm'].validate(valid => {
          resolve(valid)
        })
      }))
      let res = await Promise.all(validataArry)
      if (res.includes(false)) {
        return false
      }
      else {
        return true;
      }
    },
    changeTableData() { },
    async submitForm() {
      this.submitLoading = true;
      let valid = await this.aysncValidateForm();
      if (valid == false) {
        this.submitLoading = false;
        return false;
      }
      this.changeTableData();
      //格式化数据
      let newObj = this.getFormData();

      //如果没有传入参数就是新增
      if (!this.keyValue) {

        request({
          url: baseUrl + "/" + this.addressUrl,
          method: "post",
          data: newObj
        }).then((res) => {
          this.submitLoading = false;
          this.$notify({
            title: "成功",
            message: "新增成功",
            type: "success",
          });
          this.$emit("onChange", true)
        });
      } else {
        request({
          url: baseUrl + "/" + this.addressUrl + "/" + this.keyValue,
          method: "put",
          data: newObj
        }).then((res) => {
          this.submitLoading = false;
          this.$notify({
            title: "成功",
            message: "修改成功",
            type: "success",
          });
          this.$emit("onChange", true)
        });
      }
    },
    cancelForm() {
      this.$emit("onChange", true)
    },
    formatTree(data, valueField, lableField, childField, type) {
      let tree = [];
      data.forEach((node, index) => {
        let newNode = {
          value: node[valueField],
          label: node[lableField],
        };
        if (type) {
          newNode.disabled = node[valueField] == undefined ? true : false
        }
        tree.push(newNode);
        if (node[childField] != null && node[childField].length > 0) {
          newNode.children = (this.formatTree(node[childField], valueField, lableField, childField,
            type));
        }
      }, this);
      return tree;
    },

    //辅助工作流 审批(编辑) 预留方法
    handleEdit() {
    },

    async getSupplier_scopeOptions() {
      // 注意：this.$axios是通过Vue.prototype.$axios = axios挂载产生的
      try {
        let resp = await this.$axios({
          method: 'get',
          url: baseUrl + '/data-items/hc-gyfw/detail',
        });
        if (resp.data.data) {
          this.supplier_scopeOptions = resp.data.data;
        }
      }
      catch (error) { }
    },
    //子表单权限
    getAuthorityTableChildrenList(bindTable, children) {
      let column = [];
      if (bindTable && this.formEnCodeList && this.formEnCodeList[bindTable]) {
        let formSubEnCodeList = this.formEnCodeList[bindTable];
        if (children && children.length > 0) {
          column = children.map(ele2 => {
            if (formSubEnCodeList.includes(ele2.prop)) {
              ele2.hide = false;
            }
            else {
              ele2.hide = true;
            }
            if (ele2.hide == false) {
              //工作流中系统表单必填权限
              if (this.formSubTableNotRequiredList[bindTable] != undefined) {
                if (this.formSubTableNotRequiredList[bindTable].includes(ele2.prop)) {
                  ele2.required = false;
                }
                else {
                  ele2.required = true;
                }
              }
              ele2.rules = [];
              if (ele2.required) {
                ele2.rules = ele2.ruleList;
              }
              // disabled 属性
              if (this.formSubTableDisabledList[bindTable] != undefined) {
                if (this.formSubTableDisabledList[bindTable].includes(ele2.prop)) {
                  ele2.disabled = true;
                }
                else {
                  ele2.disabled = false;
                }
              }
            }
            return ele2;
          });
        }
        return column;
      }
      else {
        return children;
      }
    },
    getFormConfig() {
      let config = {
        "fields": [{
          "__vModel__": "field100bdab",
          "__config__": {
            "label": "耗材供应商名录",
            "showLabel": false,
            "titleColor": null,
            "fontSize": null,
            "tag": "h2",
            "span": 24,
            "align": "top",
            "justify": "start",
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 100
          }
        }, {
          "__vModel__": "job",
          "__config__": {
            "label": "职级名称",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "input-tip",
            "required": true,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 101,
            "fieldLength": "50",
            "bindTable": "material_supplier",
            "bindTableField": "job",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "role_id",
          "__config__": {
            "label": "角色ID",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "input-tip",
            "required": true,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 102,
            "fieldLength": "500",
            "bindTable": "material_supplier",
            "bindTableField": "role_id",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "role_name",
          "__config__": {
            "label": "角色名称",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "input-tip",
            "required": true,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 103,
            "fieldLength": "500",
            "bindTable": "material_supplier",
            "bindTableField": "role_name",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "area",
          "__config__": {
            "label": "地区",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "input-tip",
            "required": true,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 105,
            "fieldLength": "50",
            "bindTable": "material_supplier",
            "bindTableField": "area",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "user_id",
          "__config__": {
            "label": "申请人ID",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "input-tip",
            "required": true,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 106,
            "fieldLength": "50",
            "bindTable": "material_supplier",
            "bindTableField": "user_id",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "apply_time",
          "__config__": {
            "label": "申请时间",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "input-tip",
            "required": true,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 107,
            "fieldLength": 500,
            "bindTable": "material_supplier",
            "bindTableField": "apply_time",
            "bindTableFieldType": "datetime"
          }
        }, {
          "__vModel__": "user_name",
          "__config__": {
            "label": "申请人名称",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "input-tip",
            "required": true,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 108,
            "fieldLength": "50",
            "bindTable": "material_supplier",
            "bindTableField": "user_name",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "depart_short_name",
          "__config__": {
            "label": "部门简称",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "input-tip",
            "required": true,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 109,
            "fieldLength": "200",
            "bindTable": "material_supplier",
            "bindTableField": "depart_short_name",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "depart_id",
          "__config__": {
            "label": "部门",
            "showLabel": true,
            "tag": "el-select",
            "avueType": "select",
            "span": 24,
            "required": true,
            "saveField": "",
            "showField": "",
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 110,
            "fieldLength": "50",
            "bindTable": "material_supplier",
            "bindTableField": "depart_id",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "current_user_id",
          "__type__": "info",
          "infoType": "user",
          "__organize__": true,
          "__config__": {
            "label": "当前用户",
            "showLabel": true,
            "tag": "avue-information-body",
            "avueType": "information-body",
            "defaultValue": "21db6a365d2f1254dac92f9ec314deaa",
            "required": false,
            "span": 24,
            "whetherToRebindSecondaryEditing": false,
            "bindTableField": "current_user_id",
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 111,
            "fieldLength": "50",
            "bindTable": "material_supplier",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "is_effective",
          "__config__": {
            "label": "是否生效",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "input-tip",
            "required": true,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 112,
            "fieldLength": "1",
            "bindTable": "material_supplier",
            "bindTableField": "is_effective",
            "bindTableFieldType": "int"
          }
        }, {
          "__vModel__": "supplier_scope",
          "__config__": {
            "label": "供应范围",
            "showLabel": true,
            "tag": "el-select",
            "avueType": "select",
            "span": 24,
            "required": true,
            "saveField": "",
            "showField": "",
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 113,
            "dataType": "dataItem",
            "dataItem": "gyfw",
            "fieldLength": "20",
            "bindTable": "material_supplier",
            "bindTableField": "supplier_scope",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "address",
          "__config__": {
            "label": "省市区",
            "showLabel": true,
            "tag": "avue-select-area",
            "avueType": "select-area",
            "span": 24,
            "required": true,
            "saveField": "",
            "showField": "",
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 114,
            "fieldLength": "300",
            "bindTable": "material_supplier",
            "bindTableField": "address",
            "bindTableFieldType": "varchar"
          }
        }, {
          "tempType": "textarea",
          "__vModel__": "address_desc",
          "__config__": {
            "label": "",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "textarea",
            "required": true,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 115,
            "fieldLength": 2000,
            "bindTable": "material_supplier",
            "bindTableField": "address_desc",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "supplier_name",
          "__config__": {
            "label": "供应商名称",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "input-tip",
            "required": true,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 116,
            "fieldLength": "200",
            "bindTable": "material_supplier",
            "bindTableField": "supplier_name",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "receive_account",
          "__config__": {
            "label": "收款账户",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "input-tip",
            "required": true,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 117,
            "fieldLength": 500,
            "bindTable": "material_supplier",
            "bindTableField": "receive_account",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "buiness_license_file_url",
          "__config__": {
            "label": "营业执照",
            "tag": "el-upload",
            "avueType": "upload",
            "defaultValue": null,
            "showLabel": true,
            "required": true,
            "span": 24,
            "showTip": false,
            "buttonText": "点击上传",
            "fileSize": 2,
            "sizeUnit": "MB",
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 118,
            "fieldLength": 2000,
            "bindTable": "material_supplier",
            "bindTableField": "buiness_license_file_url",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "safe_license_file_url",
          "__config__": {
            "label": "安全生产许可证",
            "tag": "el-upload",
            "avueType": "upload",
            "defaultValue": null,
            "showLabel": true,
            "required": true,
            "span": 24,
            "showTip": false,
            "buttonText": "点击上传",
            "fileSize": 2,
            "sizeUnit": "MB",
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 119,
            "fieldLength": 2000,
            "bindTable": "material_supplier",
            "bindTableField": "safe_license_file_url",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "check_file_url",
          "__config__": {
            "label": "质检报告/检测报告",
            "tag": "el-upload",
            "avueType": "upload",
            "defaultValue": null,
            "showLabel": true,
            "required": true,
            "span": 24,
            "showTip": false,
            "buttonText": "点击上传",
            "fileSize": 2,
            "sizeUnit": "MB",
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 120,
            "fieldLength": 2000,
            "bindTable": "material_supplier",
            "bindTableField": "check_file_url",
            "bindTableFieldType": "varchar"
          }
        }, {
          "tempType": "textarea",
          "__vModel__": "field121f2da",
          "__type__": "opinion",
          "__config__": {
            "label": "意见簿",
            "showLabel": true,
            "tag": "xjr-opinion-comonent",
            "defaultValue": null,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 121
          }
        }]
      };
      return config;
    },
  }
}

</script>
<style>
.el-table__empty-block {
  width: 100% !important;
}

.avue-form__row {
  padding: 0 !important;
}

#editorphone {
  width: 375px;
  margin: 0 auto;
  border: 1px solid #E4E7ED;
  padding: 0 7.5px;
  background: #f5f6fa;
  height: 700px;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 5px;
}

#editorphone .el-col {
  border-bottom: 1px solid #F2F2F2;
  background: #fff;
  margin-bottom: 0;
  padding: 0 15px 6px !important;
  width: 100%;
}

#editorphone .el-form-item__label {
  line-height: 20px
}

#editorphone .el-input-group .el-input__inner {
  background: #f5f6fa
}

#editorphone .el-input__inner {
  border: 0
}

#editorphone .el-input-group__append,
#editorphone .el-input-group__prepend {
  border: 0;
  background: #edeef2;
  color: #666;
}

#editorphone .el-input-group .el-input__prefix {
  left: 44px
}

#editorphone .el-input-group .el-input__suffix {
  right: 44px
}

#editorphone .el-form-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-flow: wrap;
}

#editorphone .el-form-item__label {
  float: none;
  min-width: 85px;
  width: auto !important;
  text-align: left;
  flex: auto;
}

#editorphone .tinymce .el-form-item__label {
  min-width: 100%;
}

#editorphone .el-form-item__content {
  margin-left: 0px !important;
  flex: auto;
  width: calc(100% - 95px);
}

#editorphone .avueFormNoLable .el-form-item__label,
#editorphone .avueFormNoLable .avue-crud__pagination {
  display: none;
}

#editorphone .avueFormNoLable .el-collapse-item__wrap,
#editorphone .avueFormNoLable .el-collapse {
  border-bottom: 0
}

#editorphone .avueFormNoLable .el-col {
  border-bottom: 0;
  padding-bottom: 0
}

#editorphone .el-form-item__content .el-button:first-child {
  margin-left: 90px;
}

.el-upload__tip {
  line-height: 1.2;
}

.table {
  width: 100%;
}

.table-header {
  width: 100%;
  height: 40px;
  border: 1px solid #F2F2F2;
  background: #F2F2F2;
  display: flex;
  flex-direction: row;
}

.itemsss {
  width: 150px;
  height: 100%;
  border: 1px solid #999;
  text-align: center;
}

.table-body {
  width: 100%;
  height: 37px;
  border: 1px solid #F2F2F2;
  display: flex;
  flex-direction: row;
}

.payment_detail-items {
  width: 800px;
  height: 40px;
  display: flex;
  flex-direction: row;
}
</style>
